import { createStore } from "vuex";

export default createStore({
  state: {
    pathName: "",
    currDbSource: {},
    currJobData: {},
    DbSource: [],
    uid: "",
    id: "",
  },
  mutations: {
    // 保存当前菜单栏的路径
    savePath(state, pathName) {
      state.pathName = pathName;
    },
    //
    saveUid(state, uid) {
      state.uid = uid;
    },
    saveId(state, id) {
      state.id = id;
    },
    // 保存当前点击的数据源
    saveCurrDbSource(state, currDbSource) {
      state.currDbSource = currDbSource;
    },
    // 保存当前点击的元数据
    saveCurrJobData(state, currJobData) {
      state.currJobData = currJobData;
    },
    // 保存所有数据源
    saveDbSource(state, DbSource) {
      state.DbSource = DbSource;
    },
  },
});
